namespace DesignPattern.Decorator
{
    public interface ILogger
    {
        void Write(string message);
    }

    public class TextFileLogger : ILogger
    {
        private readonly ITextFileWritter _textFileWritter;

        public TextFileLogger(ITextFileWritter textFileWritter)
        {
            _textFileWritter = textFileWritter;
        }

        public void Write(string message)
        {
            _textFileWritter.Write(message);
        }
    }

    public class MSMQLogger : ILogger
    {
        private readonly IMSMQWritter _msmqWritter;

        public MSMQLogger(IMSMQWritter textFileWritter)
        {
            _msmqWritter = textFileWritter;
        }

        public void Write(string message)
        {
            _msmqWritter.Write(message);
        }
    }

    public class DatabaseLogger : ILogger
    {
        private readonly IDatabaseWritter _databaseWritter;
        public DatabaseLogger(IDatabaseWritter textFileWritter)
        {
            _databaseWritter = textFileWritter;
        }

        public void Write(string message)
        {
            _databaseWritter.Write(message);
        }
    }
}